package naga.x.platform2.channel.sina.support;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import com.alibaba.fastjson.JSON;

import naga.x.platform2.App;

@Configuration
@EnableAutoConfiguration
@ConfigurationProperties(locations = "classpath:sina.properties")
public class SinaConfig implements InitializingBean {

	private String appKey;
	private String appSec; // 支付签名key
	private String signKey; // 普通签名key
	private String clientUrl; // 客户端url
	private String validateUserUrl; // 验证用户url
	private String payUrl; // 支付下单url
	private String shareUrl; // 微博分享url

	public String getAppKey() {
		return appKey;
	}

	public void setAppKey(String appKey) {
		this.appKey = appKey;
	}

	public String getAppSec() {
		return appSec;
	}

	public void setAppSec(String appSec) {
		this.appSec = appSec;
	}

	public String getSignKey() {
		return signKey;
	}

	public void setSignKey(String signKey) {
		this.signKey = signKey;
	}

	public String getClientUrl() {
		return clientUrl;
	}

	public void setClientUrl(String clientUrl) {
		this.clientUrl = clientUrl;
	}

	public String getValidateUserUrl() {
		return validateUserUrl;
	}

	public void setValidateUserUrl(String validateUserUrl) {
		this.validateUserUrl = validateUserUrl;
	}

	public String getPayUrl() {
		return payUrl;
	}

	public void setPayUrl(String payUrl) {
		this.payUrl = payUrl;
	}

	public String getShareUrl() {
		return shareUrl;
	}

	public void setShareUrl(String shareUrl) {
		this.shareUrl = shareUrl;
	}
	
	@Override
	public String toString() {
		return "[appKey=" + appKey + ", appSec=" + appSec + ", signKey=" + signKey + ", clientUrl="
				+ clientUrl + ", validateUserUrl=" + validateUserUrl + ", payUrl=" + payUrl + ", shareUrl=" + shareUrl
				+ "]";
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		App.LOG.info("[SINA CONFIG LOADED]{}", this);
	}

}
